#include "TestScene2.h"

using namespace cocos2d;

CCScene* TestScene2::scene()
{
	CCScene* scene = CCScene::create();

	TestScene2 *layer = TestScene2::create();

	scene->addChild(layer);

	return scene;
}

bool TestScene2::init()
{
	if( !CCLayerColor::initWithColor(ccc4(0,255,0,255)) )
		{
			return false;
		}

	CCMenuItemFont* item1 = CCMenuItemFont::create(
									"Close Scene 2",
									this,
									menu_selector(TestScene2::doClose)
	);
	item1->setColor(ccc3(0,0,0));

	CCMenu* pMenu = CCMenu::create(item1,NULL);

	pMenu->setPosition(ccp(240,50));

	this->addChild(pMenu);

	return true;
}

void TestScene2::doClose(CCObject* pSender)
{
	CCDirector::sharedDirector()->popScene();
}
